package com.qf.grabtickets.mqlisten;

import com.qf.grabtickets.esvo.EsLogs;
import com.qf.grabtickets.reponsitory.EsLogsRe;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @version 1.0
 * @Author liujinchi
 * @Date 2023/3/11 11:23
 * @注释
 */
@Component
public class ESCus {

    @Autowired
    EsLogsRe esLogsRe;

    @RabbitListener(queues = "queueES")
    public void esCus(Map map){
        String log = map.toString();

        EsLogs esLogs = new EsLogs();

        esLogs.setLogs(log);

        esLogsRe.index(esLogs);
    }
}
